package ualrcdg.server;

import java.nio.file.Path;

import ualrcdg.shared.dto.Game;

/**
 * Data transfer object that wraps a CDG game along with its CDG Server-generated ID and a path to the directory containing all of its associated files. 
 */
public class GameWrapper
{
	Game game;
	final String id;
	final Path resourcePath;
	
	/**
	 * Primary constructor
	 * 
	 * @param game the CDG Game to be associated with this GameWrapper instance
	 * @param id the id of the associated game
	 * @param rootPath the path which contains all files associated with the given game
	 */
	public GameWrapper( Game game, String id, Path rootPath )
	{
		this.game = game;
		this.id = id;
		this.resourcePath = rootPath.resolve( id );
	}

	/*
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString( )
	{
		return "GameWrapper [id=" + id + ", gameName=" + game.getName( ) + ", resourcePath=" + resourcePath + "]";
	}
}
